#include<stdio.h>
#include<string.h>
#include"myStdio.h"
#include<unistd.h>

int main()
{
    MyFile* fp = Myfopen("file.txt","a");
    if(fp == NULL)
    {
        perror("open failed!\n");
        return 1;
    }

    char* str = (char*)"hello linux";
    int len = strlen(str);

    int cnt = 5;
    while(cnt--)
    {
        Mywrite(fp,str,len);
        Myfflush(fp);
        printf("buffer:", fp->buffer);
        sleep(1);
    }
    
    Myclose(fp);


	return 0;
}
